package com.jerry.controller;

/**
 * @Description 
 * @author Jerry
 * @date 2016-08-15
 */
public class User {
//    public interface WithoutPasswordView {};
//    public interface WithPasswordView extends WithoutPasswordView {};
//
//    private String username;
//    private String password;
//
//    public User() {
//    }
//
//    public User(String username, String password) {
//        this.username = username;
//        this.password = password;
//    }
//
//    @JsonView(WithoutPasswordView.class)
//    public String getUsername() {
//        return this.username;
//    }
//
//    @JsonView(WithPasswordView.class)
//    public String getPassword() {
//        return this.password;
//    }
//
//    public static void main(String[] args) throws IOException {
//        ObjectMapper objectMapper = new ObjectMapper();
//        //创建对象
//        User user = new User("isea533","123456");
//        //序列化
//        ByteArrayOutputStream bos = new ByteArrayOutputStream();
//        objectMapper.writerWithView(User.WithoutPasswordView.class).writeValue(bos, user);
//        System.out.println(bos.toString());
//
//        bos.reset();
//        objectMapper.writerWithView(User.WithPasswordView.class).writeValue(bos, user);
//        System.out.println(bos.toString());
//    }
}
